﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Moki.Core
{
    /// <summary>
    /// Determines whether given argument satisfies given condtion. 
    /// </summary>
    internal class Matcher
    {
        public Matcher(Func<object, bool> predicate)
        {
            _condition = new Condition<object>(predicate);
        }

        public Matcher(ICondition condition)
        {
            _condition = condition;
        }

        private ICondition _condition { get; set; }

        public bool Match(object obj)
        {
            return _condition.Apply(obj);
        }
    }
}
